function synNcCompany() {
	var btnObj = jQuery("#ncCompanyBtn");
	var spanObj = jQuery("#ncCompanyMsg");
	var imgObj = jQuery("#ncCompanyImg");
	var url = "/SynNcCtrl.synNcCompany.app";
	jQuery.ajax({
		url: url,
		async:true,
		timeout:1000*60*30,    
	    dataType:"json",
	    beforeSend:function(xhr){
	    	imgObj.show();
	    	btnObj.hide();
	    	spanObj.text("");
	    	disabledBtn();
	    },
	    success:function(o,textStatus,jqXHR){
	    	var result = o.result;
	    	if(result){
	    		if(result.flag){
	    			spanObj.text("本次执行耗时:["+o.useDate+"];同步成功:[接口数据:"+result.interfaceDataNum+",新增数据:"+result.insertNum+",更新数据:"+result.updateNum+"]");
	    		}else{
	    			spanObj.text("本次执行耗时:["+o.useDate+"];同步失败:[接口数据:"+result.interfaceDataNum+",新增数据:"+result.insertNum+",更新数据:"+result.updateNum+",错误信息:"+result.msg+"]");
	    		}
	    		
	    	}else{
	    		spanObj.text("结果异常！");
	    	}
	    },
	    error:function(xhr,textStatus){
	    	spanObj.text("同步异常！");
	    },
	    complete:function(){
	    	imgObj.hide();
	    	btnObj.show();
	    	showBtn();
	    }
	});
}

function synNcDept() {
	var btnObj = jQuery("#ncDeptBtn");
	var spanObj = jQuery("#ncDeptMsg");
	var imgObj = jQuery("#ncDeptImg");
	var url = "/SynNcCtrl.synNcDept.app";
	jQuery.ajax({
		url: url,
		async:true,
		timeout:1000*60*30,    
	    dataType:"json",
	    beforeSend:function(xhr){
	    	imgObj.show();
	    	btnObj.hide();
	    	spanObj.text("");
	    	disabledBtn();
	    },
	    success:function(o,textStatus,jqXHR){
	    	var result = o.result;
	    	if(result){
	    		if(result.flag){
	    			spanObj.text("本次执行耗时:["+o.useDate+"];同步成功:[接口数据:"+result.interfaceDataNum+",新增数据:"+result.insertNum+",更新数据:"+result.updateNum+"]");
	    		}else{
	    			spanObj.text("本次执行耗时:["+o.useDate+"];同步失败:[接口数据:"+result.interfaceDataNum+",新增数据:"+result.insertNum+",更新数据:"+result.updateNum+",错误信息:"+result.msg+"]");
	    		}
	    		
	    	}else{
	    		spanObj.text("结果异常！");
	    	}
	    },
	    error:function(xhr,textStatus){
	    	spanObj.text("同步异常！");
	    },
	    complete:function(){
	    	imgObj.hide();
	    	btnObj.show();
	    	showBtn();
	    }
	});
}

function synNcPsn() {
	var btnObj = jQuery("#ncPsnBtn");
	var spanObj = jQuery("#ncPsnMsg");
	var imgObj = jQuery("#ncPsnImg");
	var url = "/SynNcCtrl.synNcPsn.app";
	jQuery.ajax({
		url: url,
		async:true,
		timeout:1000*60*30,    
	    dataType:"json",
	    beforeSend:function(xhr){
	    	imgObj.show();
	    	btnObj.hide();
	    	spanObj.text("");
	    	disabledBtn();
	    },
	    success:function(o,textStatus,jqXHR){
	    	var result = o.result;
	    	if(result){
	    		if(result.flag){
	    			spanObj.text("本次执行耗时:["+o.useDate+"];同步成功:[接口数据:"+result.interfaceDataNum+",新增数据:"+result.insertNum+",更新数据:"+result.updateNum+"]");
	    		}else{
	    			spanObj.text("本次执行耗时:["+o.useDate+"];同步失败:[接口数据:"+result.interfaceDataNum+",新增数据:"+result.insertNum+",更新数据:"+result.updateNum+",错误信息:"+result.msg+"]");
	    		}
	    		
	    	}else{
	    		spanObj.text("结果异常！");
	    	}
	    },
	    error:function(xhr,textStatus){
	    	spanObj.text("同步异常！");
	    },
	    complete:function(){
	    	imgObj.hide();
	    	btnObj.show();
	    	showBtn();
	    }
	});
}

function synNcClient() {
	var btnObj = jQuery("#ncClientBtn");
	var spanObj = jQuery("#ncClientMsg");
	var imgObj = jQuery("#ncClientImg");
	var url = "/SynNcCtrl.synNcClient.app";
	jQuery.ajax({
		url: url,
		async:true,
		timeout:1000*60*30,    
	    dataType:"json",
	    beforeSend:function(xhr){
	    	imgObj.show();
	    	btnObj.hide();
	    	spanObj.text("");
	    	disabledBtn();
	    },
	    success:function(o,textStatus,jqXHR){
	    	var result = o.result;
	    	if(result){
	    		if(result.flag){
	    			spanObj.text("本次执行耗时:["+o.useDate+"];同步成功:[接口数据:"+result.interfaceDataNum+",新增数据:"+result.insertNum+",更新数据:"+result.updateNum+"]");
	    		}else{
	    			spanObj.text("本次执行耗时:["+o.useDate+"];同步失败:[接口数据:"+result.interfaceDataNum+",新增数据:"+result.insertNum+",更新数据:"+result.updateNum+",错误信息:"+result.msg+"]");
	    		}
	    		
	    	}else{
	    		spanObj.text("结果异常！");
	    	}
	    },
	    error:function(xhr,textStatus){
	    	spanObj.text("同步异常！");
	    },
	    complete:function(){
	    	imgObj.hide();
	    	btnObj.show();
	    	showBtn();
	    }
	});
}

function synNcIncome() {
	var btnObj = jQuery("#ncIncomeBtn");
	var spanObj = jQuery("#ncIncomeMsg");
	var imgObj = jQuery("#ncIncomeImg");
	var url = "/SynNcCtrl.synNcIncome.app";
	jQuery.ajax({
		url: url,
		async:true,
		timeout:1000*60*30,    
	    dataType:"json",
	    beforeSend:function(xhr){
	    	imgObj.show();
	    	btnObj.hide();
	    	spanObj.text("");
	    	disabledBtn();
	    },
	    success:function(o,textStatus,jqXHR){
	    	var result = o.result;
	    	if(result){
	    		if(result.flag){
	    			spanObj.text("本次执行耗时:["+o.useDate+"];同步成功:[接口数据:"+result.interfaceDataNum+",新增数据:"+result.insertNum+",更新数据:"+result.updateNum+"]");
	    		}else{
	    			spanObj.text("本次执行耗时:["+o.useDate+"];同步失败:[接口数据:"+result.interfaceDataNum+",新增数据:"+result.insertNum+",更新数据:"+result.updateNum+",错误信息:"+result.msg+"]");
	    		}
	    		
	    	}else{
	    		spanObj.text("结果异常！");
	    	}
	    },
	    error:function(xhr,textStatus){
	    	spanObj.text("同步异常！");
	    },
	    complete:function(){
	    	imgObj.hide();
	    	btnObj.show();
	    	showBtn();
	    }
	});
}

function synNcBillType() {
	var btnObj = jQuery("#ncBillTypeBtn");
	var spanObj = jQuery("#ncBillTypeMsg");
	var imgObj = jQuery("#ncBillTypeImg");
	var url = "/SynNcCtrl.synNcBillType.app";
	jQuery.ajax({
		url: url,
		async:true,
		timeout:1000*60*30,    
	    dataType:"json",
	    beforeSend:function(xhr){
	    	imgObj.show();
	    	btnObj.hide();
	    	spanObj.text("");
	    	disabledBtn();
	    },
	    success:function(o,textStatus,jqXHR){
	    	var result = o.result;
	    	if(result){
	    		if(result.flag){
	    			spanObj.text("本次执行耗时:["+o.useDate+"];同步成功:[接口数据:"+result.interfaceDataNum+",新增数据:"+result.insertNum+",更新数据:"+result.updateNum+"]");
	    		}else{
	    			spanObj.text("本次执行耗时:["+o.useDate+"];同步失败:[接口数据:"+result.interfaceDataNum+",新增数据:"+result.insertNum+",更新数据:"+result.updateNum+",错误信息:"+result.msg+"]");
	    		}
	    		
	    	}else{
	    		spanObj.text("结果异常！");
	    	}
	    },
	    error:function(xhr,textStatus){
	    	spanObj.text("同步异常！");
	    },
	    complete:function(){
	    	imgObj.hide();
	    	btnObj.show();
	    	showBtn();
	    }
	});
}


function disabledBtn(){
	jQuery(".e8_btn_top").each(function(i,e){
		jQuery(e).attr("disabled","true");
	});
}

function showBtn(){
	jQuery(".e8_btn_top").each(function(i,e){
		jQuery(e).removeAttr("disabled");
	});
}


